a tool for shared writing and social publishing

disable poll edit on read view of pub polls

+4 -3
+4 -3
components/Blocks/PublicationPollBlock.tsx
··· 102 102 /> 103 103 ))} 104 104 105 - {!props.isPublished && ( 105 + {!props.isPublished && permission_set.permissions.write && ( 106 106 <button 107 107 className="pollAddOption w-fit flex gap-2 items-center justify-start text-sm text-accent-contrast" 108 108 onClick={async () => { ··· 136 136 canDelete: boolean; 137 137 }) => { 138 138 let { rep } = useReplicache(); 139 + let { permissions } = useEntitySetContext(); 139 140 let optionName = useEntity(props.entityID, "poll-option/name")?.data.value; 140 141 141 142 return ( ··· 145 146 type="text" 146 147 className="pollOptionInput w-full input-with-border" 147 148 placeholder="Option here..." 148 - disabled={props.disabled} 149 + disabled={props.disabled || !permissions.write} 149 150 value={optionName || ""} 150 151 onChange={async (e) => { 151 152 await rep?.mutate.assertFact([ ··· 168 169 }} 169 170 /> 170 171 171 - {props.canDelete && ( 172 + {permissions.write && props.canDelete && ( 172 173 <button 173 174 tabIndex={-1} 174 175 className="text-accent-contrast"